//---------------------------------------------------------------------------- // File: OS_Types.h // Type: General Types & Definitions used in OS // Author: Ken Anderson // Date: 3/9/3 -- 5:45PM // OS dependant: NA // // Notes: Contains a set of general definitions, types, & structures that are // used widely in OS systems or are just used in one but still requires // a custom structure or type to gather the data. // // Header file's required: // 1) Common.h -- Contains core C headers as well as common definitions. // //---------------------------------------------------------------------------- #ifndef __OS_TYPES__ #define __OS_TYPES__ #include "Common.h" //////////////////////////// // OS Structures // //////////////////////////// //The dimensions of a rectangle used commonly in OSes typedef Rect OSRect; typedef PRect POSRect; ///////////////////////////// // DEFINITIONS // ///////////////////////////// typedef Word MSG_EVENT; //All Message events are Word data types. ///////////////////////////// // MSG STRUCTURE // ///////////////////////////// typedef struct tg_MSG_BLOCK { MSG_EVENT event; //The actual message. Dword value; //The value of the message. } Msg, *PMsg; ///////////////////////////// // OS QUERY STRUCTURE // ///////////////////////////// typedef struct tg_OS_QUERY { Bool bGUI; //Does the operating system support a graphic interface system. cstr zcPLATFORM; //A small string that contains the name of the platform. Byte byBITSPIXEL; //The Depth of the color currently being displayed. Word wDESKTOPHEIGHT; //The Height of the desktop. Word wDESKTOPWIDTH; //THe Width of the desktop. OSRect rcWORKEAREA; //Workarea of the desktop. } *POSQuery, OSQuery; ///////////////////////////// // FONT MAPPING // ///////////////////////////// // Caution: There are two pointers // in the font map structure // and attention needs to be // taken when monitor the pointers // and to clean the set up when // the structure is done. // Failure to do so can leave the system // unstable. ////////////////////////////// typedef struct FONT_MAP { void* pciMedia; PFRect pfrcCoords; int pnCoordNum; float fMaxWidth; float fMaxHeight; } FONTMAP, *PFONTMAP; //Operating System Window Order typedef enum OSZOrder { //////////////////////////// //COMMON WINDOWS OS ORDERS// //////////////////////////// ZO_BOTTOM, //Places the window in back of all other windows. ZO_NOTOPMOST, //Places the window behind the top most. ZO_TOP, //Places the window in the front. ZO_TOPMOST //Always on top. //////////////////////////// //COMMON WINDOWS OS ORDERS// //////////////////////////// } *POSZOrder; typedef enum OS_TIMER_STATE { TS_STOP, TS_START, TS_PAUSE, TS_ADVANCE, TS_GETCOMPLETETIME, TS_GETSESSIONTIME, TS_GETELAPSEDTIME } OSTimerState; //////////////////////////// //COMMON WINDOWS OS SYTLES// ///////////////////////////////////////////////////////////////////////////////////////////////////////// //For more information on the following styles, consult the current operating systems Developement Kits //documentation. Below are common windows sytles for the windows operating system, please refer to //MSDN Windows API for more information on the following styles below. ///////////////////////////////////////////////////////////////////////////////////////////////////////// #define OS_WS_BORDER 0x00000001 //The window contains borders. #define OS_WS_CAPTION 0x00000002 //Creates a window with a title bar and a border. Can't use with WST_DLGFRAME. #define OS_WS_CHILD 0x00000004 //Creates a child window, can not be used with WS_POPUP. #define OS_WS_CLIPCHILDREN 0x00000008 //Clips children during painting #define OS_WS_CLIPSIBLINGS 0x00000010 //Clips other children window during painting. #define OS_WS_DISABLED 0x00000020 //Disabled Window #define OS_WS_DLGFRAME 0x00000040 //Double bordered window with no caption(title bar). #define OS_WS_HSCROLL 0x00000080 //Creates a window with a horizontal scrolling bar. #define OS_WS_VSCROLL 0x00000100 //Creates a window with a veritcal scrolling bar. #define OS_WS_MAXIMIZE 0x00000200 //Creates a window that is maximized. #define OS_WS_MINIMIZE 0x00000400 //Creates a window that is minimized. #define OS_WS_OVERLAPPED 0x00000800 //Creates a window with a caption and border. #define OS_WS_OVERLAPPEDWINDOW 0x00001000 //Creates a window with following styles: WST_OVERLAPPED, WST_CAPTION, WST_THICKFRAME, WST_SYSMENU, WST_MINIMIZEBOX, & WST_MAXIMIZEBOX. #define OS_WS_POPUP 0x00002000 //Creates a pop-up window. Avoid using WST_CHILD with this style. #define OS_WS_POPUPWINDOW 0x00004000 //Creates a pop-up window with the following styles: WST_BORDER, WST_SYSMENU, and WST_POPUP. #define OS_WS_SYSMENU 0x00008000 //Creates an exit button and a system menu within the titlebar #define OS_WS_THICKFRAME 0x00010000 //Creates a window with a thicker frame and that is resizable. #define OS_WS_VISIBLE 0x00020000 //Creates a window that is visible. #define OS_WS_GROUP 0x00040000 //Grouping...review Windows OS Documentation for more information. #define OS_WS_TABSTOP 0x00080000 //Tab movements...review Windows OS Documentation for more information. #define OS_WS_MINIMIZEBOX 0x00040000 //Creates a window that allows the user to minimize the window. #define OS_WS_MAXIMIZEBOX 0x00080000 //Creates a window that allows the user to maximize the window. //////////////////////////////// //COMMON FILE OPERATION FLAGS // //////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////// //For more information on the following FILE & IO communications, //consult the current operating systems Developement Kits documentation. //Below are common file operations for the common operating system. //The operational flags are based on the Windows Operating System flags: //please refer to MSDN Windows API for more information on File operation flags. ///////////////////////////////////////////////////////////////////////////////////////////////////////// #define OS_FO_QUERY 0 #define OS_FO_READ 1 #define OS_FO_WRITE 2 #define OS_FO_NO_SHARE 0 #define OS_FO_SHARE_DELETE 1 #define OS_FO_SHARE_READ 2 #define OS_FO_SHARE_WRITE 3 #define OS_FO_CREATE_NEW 0 #define OS_FO_CREATE_ALWAYS 1 #define OS_FO_OPEN_EXISTING 2 #define OS_FO_OPEN_ALWAYS 3 #define OS_FO_ATTRIBUTE_ARCHIVE 0x00000001 #define OS_FO_ATTRIBUTE_HIDDEN 0x00000002 #define OS_FO_ATTRIBUTE_NORMAL 0x00000004 #define OS_FO_ATTRIBUTE_OFFLINE 0x00000008 #define OS_FO_ATTRIBUTE_READONLY 0x00000010 #define OS_FO_ATTRIBUTE_SYSTEM 0x00000020 #define OS_FO_ATTRIBUTE_TEMPORARY 0x00000040 #endif